<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Will return a list of values if any of those pre-conditions are not met</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.enchant-dict-store-replacement.html">enchant_dict_store_replacement</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.fribidi.html">FriBiDi</a></div>
 <div class="up"><a href="ref.enchant.html">Enchant 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.enchant-dict-suggest" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">enchant_dict_suggest</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PECL enchant &gt;= 0.1.0 )</p><p class="refpurpose"><span class="refname">enchant_dict_suggest</span> &mdash; <span class="dc-title">Will return a list of values if any of those pre-conditions are not met</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.enchant-dict-suggest-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>enchant_dict_suggest</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$dict</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$word</code></span>
   )</div>

  <p class="para rdfs-comment">
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.enchant-dict-suggest-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">dict</code></em></dt>

     <dd>

      <p class="para">
       Dictionary resource
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">word</code></em></dt>

     <dd>

      <p class="para">
       Word to use for the suggestions.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.enchant-dict-suggest-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Will returns an array of suggestions if the word is bad spelled.
  </p>
 </div>



 <div class="refsect1 examples" id="refsect1-function.enchant-dict-suggest-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2404">
    <p><strong>Example #1 A <span class="function"><strong>enchant_dict_suggest()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$tag&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'en_US'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$r&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">enchant_broker_init</span><span style="color: #007700">();<br />if&nbsp;(</span><span style="color: #0000BB">enchant_broker_dict_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">$r</span><span style="color: #007700">,</span><span style="color: #0000BB">$tag</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$d&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">enchant_broker_request_dict</span><span style="color: #007700">(</span><span style="color: #0000BB">$r</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$tag</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$wordcorrect&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">enchant_dict_check</span><span style="color: #007700">(</span><span style="color: #0000BB">$d</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"soong"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">$wordcorrect</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$suggs&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">enchant_dict_suggest</span><span style="color: #007700">(</span><span style="color: #0000BB">$d</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"soong"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Suggestions&nbsp;for&nbsp;'soong':"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$suggs</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">enchant_broker_free_dict</span><span style="color: #007700">(</span><span style="color: #0000BB">$d</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">enchant_broker_free</span><span style="color: #007700">(</span><span style="color: #0000BB">$r</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.enchant-dict-suggest-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.enchant-dict-check.html" class="function" rel="rdfs-seeAlso">enchant_dict_check()</a> - Check whether a word is correctly spelled or not</span></li>
    <li class="member"><span class="function"><a href="function.enchant-dict-quick-check.html" class="function" rel="rdfs-seeAlso">enchant_dict_quick_check()</a> - Check the word is correctly spelled and provide suggestions</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.enchant-dict-store-replacement.html">enchant_dict_store_replacement</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.fribidi.html">FriBiDi</a></div>
 <div class="up"><a href="ref.enchant.html">Enchant 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
